<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>找回密码</title>
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <link href="./static/css/base.css" rel="stylesheet">
    <script src="./static/js/jquery.min.1.10.2.js" type="text/javascript" charset="utf-8"></script>
    <link href="./static/css/base.css" rel="stylesheet" charset="utf-8">
    <link href="./css/registered.css" rel="stylesheet" charset="utf-8">
</head>

<body>
	<div class="registered_input">
		<input type="tel" name="tel" id="tel" placeholder="手机号"><input class="getCode" value="获取验证码" />
		<input type="number" name="number" id="number" placeholder="验证码">
		<input type="password" name="password" id="password" placeholder="设置密码">
	</div>
	<div class="registered_btn" style="margin-top:0.5rem;">
		<div class="confirm">确认找回</div>
	</div>
	<script>
		// 获取验证码
		$('.getCode').on('click',function () {
	        time($(this));
	    });
	    var wait=60;
	    function time(o) {
	        if (wait == 0) {
	            o.removeAttr("disabled");
	            o.val("重新获取");
	            o.css('color','#fff');
	            o.css('background','#e27719');
	            wait = 60;
	        } else {
	            o.attr("disabled", true);
	            o.val(wait + "秒后重新获取");
	            o.css('color','#eee') ;
	            o.css('background','#ccc');
	            wait--;
	            setTimeout(function() {
	                    time(o)
	                },
	                1000)
	        }
	    }
		$(".confirm").on("click",function(){
			if ($('#tel').val() == '') {
                alert('手机号为空！');
            } else if ($('#number').val() == '') {
                alert('验证码为空！');
            } else if ($('#password').val() == '') {
                alert('密码为空！');
            } else {
            	// console.log("找回密码",$('#tel').val(),$('#number').val(),$('#password').val())
             //    $.ajax({
             //        url: "",
             //        type: "POST",
             //        dataType: 'json',
             //        data: {
             //            name: $('#name').val(),
             //            grade :$('#grade').val(),
             //            tel: $('#tel').val()
             //        },
             //        success: function (data) {
                       
             //        }
             //    });
             window.location.href = './login.html';
            }
		})
	</script>
</body>

</html>